﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcArchStarter.Core.Persistence
{
    public interface IUnitOfWork : IDisposable
    {
        IRepository<TEntity> RepositoryOf<TEntity>() where TEntity : class;

        /// <summary>
        /// Persist all the changes associated with this instance of Unit Of Work since last time SaveChanges was called
        /// </summary>
        void SaveChanges();
        void RejectChanges();

        bool ProxyCreationEnabled { get; set; }
        bool LazyLoadingEnabled { get; set; }
        bool AutoDetectChangesEnabled { get; set; }
        bool ValidateOnSaveEnabled { get; set; }
    }
}
